<%@ include file="/common/taglibs.jsp"%>
<%
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevent caching at the proxy server
%>

<head>
    <title><fmt:message key="articulolist.title"/></title>
    <meta name="heading" content="<fmt:message key='articulolist.heading'/>"/>    
</head>

<form:form id="articuloList">

	<fieldset style="width: 300px">
	<legend><fmt:message key="common.filtros.busqueda"/></legend>
		
		<br/><div>
			<fmt:message key="common.nombre" /><br/>
			<input type="text" id="deNombreClienteID" name="deNombreCliente" class="text medium"/>								
		</div><br/>	
		<div>
			<fmt:message key="clienteempresaform.alias" /><br/>
			<input type="text" id="deAliasID" name="deAlias" class="text medium"/>			
		</div><br/>
		
		<div>
			  <fmt:message key="clienteempresaform.ruc"/><br/>
			<input type="text" id="coRucID" name="coRuc" class="text medium"/>			
		</div><br/>
				
		<div>
			<input type="button" onclick="busquedaClientes()" value="<fmt:message key="button.search"/>"/>
		</div>					
		</fieldset><br/><br/>

		<table id="clientes" cellpadding="0" class="table" cellspacing="0" style="width: 700px" > 
			<thead> 
				<tr> 
		            <th scope="col"><fmt:message key="common.nombre"/></th>
		            <th scope="col"><fmt:message key="clienteempresaform.alias"/></th>
		            <th scope="col"><fmt:message key="clienteempresaform.ruc"/></th>
				</tr>
			</thead>
			
			<tbody id="clientesbody">
				<tr id="pattern" style="display:none;">
					<td> 
						<span id="tableNombre">Nombre</span>						
					</td>	
					<td> 
						<span id="tableAlias">Alias</span>						
					</td>			
					<td> 
						<span id="tableRuc">Ruc</span>						
					</td>
		
				</tr>
				
				<c:forEach var="cliente" items="${clientes}" varStatus="status">	
				<tr  style="display:none;">
					<c:choose>
						  <c:when test="${status.index % 2 == 0}"><tr class="odd" ></c:when>
						  <c:otherwise><tr class="even" ></c:otherwise>
					</c:choose>
		
						
						<td>
						<a href="javascript:void(0)" title="Valor" onClick="Modalbox.hide({beforeHide: function(){
						    	$('clpbClienteEmpresa.idID').value 	  = '${cliente.id}',
								$('clpbClienteEmpresa.deClienteEmpresaID').value 	  = '${cliente.deClienteEmpresa}'
						    	}})  
							"> 
		                    	${cliente.deClienteEmpresa}
		                </a>
						</td>	
						<td>
		                    	${cliente.deAlias}
		                </td> 
						<td>
		                    	${cliente.coRuc}
		                </td> 
						</tr>
		        </c:forEach>				 	
			</tbody>
		</table> 
</form:form>
<script type='text/javascript' src="<c:url value="/dwr/interface/ClienteEmpresaService.js"/>"></script>